﻿using DeviceClientGrain;
using Orleans.Streams;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DeviceDemo
{
    internal class DeviceMsgObserver : IAsyncObserver<MsgData>
    {
        public Task OnCompletedAsync() => Task.CompletedTask;

        public Task OnErrorAsync(Exception ex)
        {
            Console.WriteLine(ex);
            return Task.CompletedTask;
        }

        public Task OnNextAsync(MsgData item, StreamSequenceToken? token = null)
        {

           // Console.WriteLine($"收到来源为【{item.Souce}】的消息:{item.Data}");
           if(item.Cmd== "AGV已就位")
            {
                 
            }else if(item.Cmd== "传输完成") {  

            }else if(item.Cmd== "准备传输")
            {

            }
            return Task.CompletedTask;
        }
    }
}
